cap program drop swaprows
program define swaprows
syntax, swap(integer) and(integer)

tempvar o
gen `o' = _n
replace `o' = `and'+0.1 if `o'==`swap'
replace `o' = `swap'-0.1 if `o'==`and'
sort `o'

end


